package com.crm.common.crm.constant;


public enum BrokenLineDataEnum {

    /**
     * 线索量
     */
    LEADS_NUM(1, "线索量"),
    /**
     * 报课量
     */
    BAOKE_NUM(2, "报课量"),
    /**
     * 报课率
     */
    BAOKE_RATE(3, "报课率"),
    /**
     * 加好友量
     */
    ADD_FRIEND_NUM(4, "加好友量"),
    /**
     * 加好友率
     */
    ADD_FRIEND_RATE(5, "加好友率"),
    /**
     * 加群量
     */
    ADD_GROUP_NUM(6, "加群量"),
    /**
     * 加群率
     */
    ADD_GROUP_RATE(7, "加群率"),
    /**
     * 成交量
     */
    DEAL_NUM(8, "成交量"),
    /**
     * 成交率
     */
    DEAL_RATE(9, "成交率"),
    /**
     * KPI
     */
    KPI(10, "KPI");

    BrokenLineDataEnum(Integer type, String remarks) {
        this.type = type;
        this.remarks = remarks;
    }

    private Integer type;
    private String remarks;

    public String getRemarks() {
        return remarks;
    }

    public static BrokenLineDataEnum parse(Integer type) {
        for (BrokenLineDataEnum brokenLineDataEnum : BrokenLineDataEnum.values()) {
            if (brokenLineDataEnum.getType().equals(type)) {
                return brokenLineDataEnum;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public static BrokenLineDataEnum parse(String name) {
        for (BrokenLineDataEnum brokenLineDataEnum : BrokenLineDataEnum.values()) {
            if (brokenLineDataEnum.name().equals(name)) {
                return brokenLineDataEnum;
            }
        }
        return null;
    }

    public String getIndex() {
        return "bill_single_" + name().toLowerCase();
    }

    public String getTable() {
        return name().toLowerCase();
    }

    @Override
    public String toString() {
        return this.type.toString();
    }

}
